<?php

namespace app\admin\model\customer;

use think\Model;


class IndividualCustomer extends Model
{

    

    

    // 表名
    protected $name = 'individual_customer';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'job_status_text',
        'sex_data_text',
        'role_text',
        'position_text',
        'relationship_text',
        'character_group_text',
        'character_text',
        'is_marriage_text',
        'constellation_text',
        'salary_text'
    ];
    

    
    public function getJobStatusList()
    {
        return ['在职' => __('在职'), '离职' => __('离职')];
    }

    public function getSexDataList()
    {
        return ['男' => __('男'), '女' => __('女')];
    }

    public function getRoleList()
    {
        return [''=>'请选择','决策人' => __('决策人'), '负责人' => __('负责人'), '办事人' => __('办事人'), '影响人' => __('影响人')];
    }

    public function getPositionList()
    {
        return [''=>'请选择','自定义' => __('自定义'), '人力总监' => __('人力总监'), '人力副总' => __('人力副总'), '人力经理' => __('人力经理'), '人力专员' => __('人力专员'), '培训校长' => __('培训校长'), '培训总监' => __('培训总监'), '培训经理' => __('培训经理'), '行政总监' => __('行政总监'), '培训专员' => __('培训专员'), '行政经理' => __('行政经理'), '行政专员' => __('行政专员'), '工会主席' => __('工会主席'), '团委书记' => __('团委书记'), '采购总监' => __('采购总监'), '采购经理' => __('采购经理'), '采购专员' => __('采购专员'), '旅行社负责人' => __('旅行社负责人')];
    }

    public function getRelationshipList()
    {
        return [''=>'请选择','待激活' => __('待激活'), '陌生度' => __('陌生度'), '拒绝度' => __('拒绝度'), '麻木度' => __('麻木度'), '熟悉度' => __('熟悉度'), '敞开度' => __('敞开度'), '参与度' => __('参与度')];
    }

    public function getCharacterGroupList()
    {
        return [''=>'请选择','老虎型：强势喜欢主导和控制' => __('老虎型：强势喜欢主导和控制'), '孔雀型：爱表现被人夸奖' => __('孔雀型：爱表现被人夸奖'), '老鹰型：理性思维不易被影响' => __('老鹰型：理性思维不易被影响'), '考拉型：老好人有求必应' => __('考拉型：老好人有求必应'), '鸽子型：值传递信息不轻易表面倾向' => __('鸽子型：值传递信息不轻易表面倾向'), '变色龙型：适应能力强，因环境而变' => __('变色龙型：适应能力强，因环境而变')];
    }

    public function getCharacterList()
    {
        return [''=>'请选择','老虎型：强势喜欢主导和控制' => __('老虎型：强势喜欢主导和控制'), '孔雀型：爱表现被人夸奖' => __('孔雀型：爱表现被人夸奖'), '老鹰型：理性思维不易被影响' => __('老鹰型：理性思维不易被影响'), '考拉型：老好人有求必应' => __('考拉型：老好人有求必应'), '鸽子型：值传递信息不轻易表面倾向' => __('鸽子型：值传递信息不轻易表面倾向'), '变色龙型：适应能力强，因环境而变' => __('变色龙型：适应能力强，因环境而变')];
    }

    public function getIsMarriageList()
    {
        return ['是' => __('是'), '否' => __('否')];
    }

    public function getConstellationList()
    {
        return [''=>'请选择','白羊座' => __('白羊座'), '金牛座' => __('金牛座'), '双子座' => __('双子座'), '巨蟹座' => __('巨蟹座'), '狮子座' => __('狮子座'), '处女座' => __('处女座'), '天秤座' => __('天秤座'), '天蝎座' => __('天蝎座'), '射手座' => __('射手座'), '摩羯座' => __('摩羯座'), '水瓶座' => __('水瓶座'), '双鱼座' => __('双鱼座')];
    }

    public function getSalaryList()
    {
        return [''=>'请选择',__('Salary 1') => __('Salary 1'), __('Salary 2') => __('Salary 2'), __('Salary 3') => __('Salary 3'), __('Salary 4') => __('Salary 4'), __('Salary 5') => __('Salary 5'), __('Salary 6') => __('Salary 6')];
    }


    public function getJobStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['job_status']) ? $data['job_status'] : '');
        $list = $this->getJobStatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getSexDataTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['sex_data']) ? $data['sex_data'] : '');
        $list = $this->getSexDataList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getRoleTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['role']) ? $data['role'] : '');
        $list = $this->getRoleList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getPositionTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['position']) ? $data['position'] : '');
        $list = $this->getPositionList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getRelationshipTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['relationship']) ? $data['relationship'] : '');
        $list = $this->getRelationshipList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getCharacterGroupTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['character_group']) ? $data['character_group'] : '');
        $list = $this->getCharacterGroupList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getCharacterTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['character']) ? $data['character'] : '');
        $list = $this->getCharacterList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getIsMarriageTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['is_marriage']) ? $data['is_marriage'] : '');
        $list = $this->getIsMarriageList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getConstellationTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['constellation']) ? $data['constellation'] : '');
        $list = $this->getConstellationList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getSalaryTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['salary']) ? $data['salary'] : '');
        $list = $this->getSalaryList();
        return isset($list[$value]) ? $list[$value] : '';
    }




    public function admin()
    {
        return $this->belongsTo('app\admin\model\Admin', 'admin_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }
}
